package Controll;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import Dao.UserDao;

public class IndividualServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;

	public IndividualServlet() {
		super();
	}

	protected void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		String passwd = request.getParameter("ps");
		String uname = request.getParameter("ue");
		UserDao userDao = new UserDao();
		try {
			userDao.update(uname, passwd);
		} catch (Exception e) {
			e.printStackTrace();
		}
		request.setAttribute("message", "修改成功");
		request.getRequestDispatcher("individual.jsp").forward(request, response);
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		doGet(request, response);
	}

}
